package org.glickr.api.places

import org.glickr.api.FlickrApiMethod
import groovy.util.slurpersupport.GPathResult

/* ----------------------------------------------------------------------------------------------------
REQUEST: flickr.places.placesForBoundingBox
INFO: Return all the locations of a matching place type for a bounding box.
The maximum allowable size of a bounding box (the distance between the SW and NE corners) is governed by the place type you are requesting. Allowable sizes are as follows:
-neighbourhood: 3km (1.8mi)
-locality: 7km (4.3mi)
-county: 50km (31mi)
-region: 200km (124mi)
-country: 500km (310mi)
-continent: 1500km (932mi)

AUTHENTICATION: This method does not require authentication.

ARGUMENTS:
api_key (Required): Your API application key.
bbox (Required): A comma-delimited list of 4 values defining the Bounding Box of the area that will be searched. The 4 values represent the bottom-left corner of the box and the top-right corner, minimum_longitude, minimum_latitude, maximum_longitude, maximum_latitude.
place_type (Optional): The name of place type to using as the starting point to search for places in a bounding box. Valid placetypes are:
-neighbourhood
-locality
-county
-region
-country
-continent

The "place_type" argument has been deprecated in favor of the "place_type_id" argument. It won't go away but it will not be added to new methods. A complete list of place type IDs is available using the flickr.places.getPlaceTypes method. (While optional, you must pass either a valid place type or place type ID.)
place_type_id (Optional): The numeric ID for a specific place type to cluster photos by.
Valid place type IDs are :
-22: neighbourhood
-7: locality
-8: region
-12: country
-29: continent
(While optional, you must pass either a valid place type or place type ID.)

EXAMPLE RESPONSE:
<places place_type="neighbourhood" total="21" pages="1" page="1" bbox="-122.42307100000001,37.773779,-122.381071,37.815779">
  <place place_id=".aaSwYSbApnq6seyGw" woeid="23512025" latitude="37.788" longitude="-122.412" place_url="/United+States/California/San+Francisco/Downtown" place_type="neighbourhood">
Downtown, San Francisco, CA, US, United States
   </place>
  <place place_id="3KymK1GbCZ41eBVBxg" woeid="28288707" latitude="37.776" longitude="-122.417" place_url="/United+States/California/San+Francisco/Civic+Center" place_type="neighbourhood">
Civic Center, San Francisco, CA, US, United States
   </place>
  <place place_id="9xdhxY.bAptvBjHo" woeid="2379855" latitude="37.796" longitude="-122.407" place_url="/United+States/California/San+Francisco/Chinatown" place_type="neighbourhood">
Chinatown, San Francisco, CA, US, United States
   </place>
</places>
---------------------------------------------------------------------------------------------------- */

class placesPlacesForBoundingBox implements FlickrApiMethod {
    //
    //  API METHOD
    //
    static final String apiMethod = 'flickr.places.placesForBoundingBox'

    //
    //  VALIDATOR
    //

    //
    //  PARAMS
    //

    //
    //  PROCESSOR
    //

    //
    //  ERROR CODES
    //
}